var myticketCtrl = $.mvc.controller.create('myticket', {
    views: {
        "myticket_list_tpl": "views/myticket_list.tpl" 
    },
    /* Array of views to load */
    save: function() {
        value = $("#new-todo").val();
        $("#new-todo").val('');
        var that = this;
        var todo = new Todo();
        if(value.length == 0) return alert("Please enter some text");
        todo.text = value;

        todo.set({
            text: value
        });
        todo.save(function() {
            //var str = "<li><input id='"+todo.id+"' data-id='" + todo.id + "' class='check' type='checkbox' value='active' /><label for='"+todo.id+"'/><div class='todo-text' >" + todo.text + "</div> <span class='todo-destroy' style='display:none;'><input data-id='" + todo.id + "' type='button' class='handleArchive' value='archive' style='width: 90px;height: 43px;' /></span></li>";
            var str=$.template("list_item",{'entry':todo});
            $("#leftTodo ul").append($(str));
            that.updateCounters();
        });


    },
    
     
    cart_detail: function(id) {
         
        var carts = JSON.parse(localStorage.getItem('shopping_cart'));
        if (carts && carts.length > 0) {
            for(var i=0; i< carts.length; i++){
                if(id === carts[i][0].eventpackageID) {
                    $('#cart_detail_div').html($.template('cart_detail_tpl', {
                        item: carts[i]
                    }));
                    $.ui.loadContent("#cart_detail_panel",false,false,"slide");
                }
            }
        }
    },
    
    default:function(id) {
     
         myticket.fetchAll(function(result){
     
            $("#myticket_list").html($.template('myticket_list_tpl', {
               item: result
            }));
         });
 
    },
    /* This is executed when the controller is created.  It assumes the views are loaded, but can not interact with models
     * This is useful for wiring up page events, etc.
     */
    init: function() {
        
    }
});